/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 最终版学生成绩管理系统;
import java.sql.*;
//连接数据库类
public class DataBaseCreate {
	//连接数据库静态方法，若产生错误，则抛出相应错误信息
	public static Connection getConnection()throws SQLException,java.lang.ClassNotFoundException{
		//建立本地数据库连接，编码规则转换为utf-8(正常录入中文)
		String url="jdbc:mysql://localhost:3306/studentmanagement?useUnicode=true&characterEncoding=utf8";
		Class.forName("com.mysql.jdbc.Driver");
		String userName="root";
		Connection con=DriverManager.getConnection(url, userName, "");
		return con;
	}
}
